<template>
  <div class="loading" v-show="showLoading" id="yxp_loading">
    <div class="loading-box" id="yxp_loading_box"></div>
    <div class="loading-content" @click="handleOpen">
      <!-- <span></span>
      <span></span>
      <span></span> -->
      <div class="loading-png">
        <img src="~assets/home/birds.gif" alt="" />
      </div>
      <span class="loading-text">正在努力链接中</span>
    </div>
  </div>
</template>
<script>
export default {
  name: "loading",
  data() {
    return {};
  },
  watch: {
    showLoading(val) {
      if (val) {
        document.body.style.overflow='hidden'
      } else {
        document.body.style.overflow='visible'
      }
    }
  },
  props: {
    showLoading: {
      type: Boolean,
      default: false,
    },
  },
  methods: {
    handleOpen() {
      console.log(556777);
    },
  },
};
</script>
<style lang="less" scoped>
@keyframes hide {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes move1 {
  0% {
    transform: translateY(0) scale(1);
  }
  100% {
    transform: translateY(10px) scale(0.5);
  }
}
@keyframes move2 {
  0% {
    transform: scale(0.5);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes move3 {
  0% {
    transform: translateY(0) scale(1);
  }
  100% {
    transform: translateY(-10px) scale(0.5);
  }
}
.loading {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,.6);
  z-index: 2000;
  &-box {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    // background: rgba(255,255,255,0);
    z-index: 2002;
  }
  &-content {
    position: absolute;
    width: 400px;
    height: 300px;
    background-color: transparent;
    border-radius: 23px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    .loading-png {
      width: 60px;
      height: 60px;
      img {
        display: block;
        width: 100%;
        height: 100%;
      }
    }
    .loading-text {
      font-size: 26px;
      color: @primary-color;
      margin-top: 26px;
    }
    // span {
    //   display: inline-block;
    //   width: 20px;
    //   height: 20px;
    //   background: #27bfa3;
    //   border-radius: 10px;
    //   margin-right: 5px;
    //   &:nth-child(1) {
    //     animation: move1 0.5s ease-out infinite;
    //   }
    //   &:nth-child(2) {
    //     animation: move2 0.5s ease-out infinite;
    //   }
    //   &:nth-child(3) {
    //     animation: move3 0.5s ease-out infinite;
    //   }
    // }
  }
}
</style>
